<!DOCTYPE html>
<html lang="en">
<head>
    
    <meta charset="utf-8">
    <title>Subform - Aliwork helper</title>
    
    <meta name="description" content="宜搭前端 JS 工具代码库" />
    
        <meta name="keywords" content="Aliwork 宜搭 工具库" />
        <meta name="keyword" content="Aliwork 宜搭 工具库" />
    
    
    
    <script src="scripts/prettify/prettify.js"></script>
    <script src="scripts/prettify/lang-css.js"></script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
    <script src="scripts/nav.js" defer></script>
    
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>

<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
  <div class="navicon"></div>
</label>

<label for="nav-trigger" class="overlay"></label>

<nav >
    
    <input type="text" id="nav-search" placeholder="Search" />
    
    
    <h2><a href="index.html">Home</a></h2><h2><a href="https://github.com/hackingzhang/aliwork-helper" target="_blank" class="menu-item" >Github</a></h2><h2><a href="https://gitee.com/hexzhangshuai/aliwork-helper" target="_blank" class="menu-item" >Gitee码云</a></h2><h2><a href="https://docs.aliwork.com/docs/developer/api/about" target="_blank" class="menu-item" >宜搭开放API</a></h2><h3>Modules</h3><ul><li><a href="module-DataLinkage.html">DataLinkage</a><ul class='methods'><li data-type='method'><a href="module-DataLinkage.html#.dataLinkage">dataLinkage</a></li><li data-type='method'><a href="module-DataLinkage.html#.dataLinkageSubform">dataLinkageSubform</a></li><li data-type='method'><a href="module-DataLinkage.html#~resolveConditionMap">resolveConditionMap</a></li></ul></li><li><a href="module-DataSource.html">DataSource</a><ul class='methods'><li data-type='method'><a href="module-DataSource.html#.deleteFormData">deleteFormData</a></li><li data-type='method'><a href="module-DataSource.html#.executeTask">executeTask</a></li><li data-type='method'><a href="module-DataSource.html#.fetchSubformDatas">fetchSubformDatas</a></li><li data-type='method'><a href="module-DataSource.html#.fetchSubformDatasAll">fetchSubformDatasAll</a></li><li data-type='method'><a href="module-DataSource.html#.getFormData">getFormData</a></li><li data-type='method'><a href="module-DataSource.html#.getOperationRecords">getOperationRecords</a></li><li data-type='method'><a href="module-DataSource.html#.saveFormData">saveFormData</a></li><li data-type='method'><a href="module-DataSource.html#.searchFormDataIds">searchFormDataIds</a></li><li data-type='method'><a href="module-DataSource.html#.searchFormDataIdsAll">searchFormDataIdsAll</a></li><li data-type='method'><a href="module-DataSource.html#.searchFormDatas">searchFormDatas</a></li><li data-type='method'><a href="module-DataSource.html#.searchFormDatasAll">searchFormDatasAll</a></li><li data-type='method'><a href="module-DataSource.html#.startInstance">startInstance</a></li><li data-type='method'><a href="module-DataSource.html#.updateFormData">updateFormData</a></li></ul></li><li><a href="module-Field.html">Field</a><ul class='methods'><li data-type='method'><a href="module-Field.html#.activateTabItems">activateTabItems</a></li><li data-type='method'><a href="module-Field.html#.fieldToString">fieldToString</a></li><li data-type='method'><a href="module-Field.html#.fieldValueDiff">fieldValueDiff</a></li><li data-type='method'><a href="module-Field.html#.fieldValueEqualSingle">fieldValueEqualSingle</a></li><li data-type='method'><a href="module-Field.html#.generateAssociationFormFieldData">generateAssociationFormFieldData</a></li><li data-type='method'><a href="module-Field.html#.generateDptFieldData">generateDptFieldData</a></li><li data-type='method'><a href="module-Field.html#.generateEmployeeFieldData">generateEmployeeFieldData</a></li><li data-type='method'><a href="module-Field.html#.getFieldDataTypeById">getFieldDataTypeById</a></li><li data-type='method'><a href="module-Field.html#.getFieldTypeById">getFieldTypeById</a></li><li data-type='method'><a href="module-Field.html#.mergeTo">mergeTo</a></li><li data-type='method'><a href="module-Field.html#.syncTo">syncTo</a></li></ul></li><li><a href="module-Subform.html">Subform</a><ul class='methods'><li data-type='method'><a href="module-Subform.html#.associateForm2Subform">associateForm2Subform</a></li><li data-type='method'><a href="module-Subform.html#.sum2Main">sum2Main</a></li><li data-type='method'><a href="module-Subform.html#~resolveFieldMaps">resolveFieldMaps</a></li></ul></li><li><a href="module-UI.html">UI</a><ul class='methods'><li data-type='method'><a href="module-UI.html#.dialog">dialog</a></li><li data-type='method'><a href="module-UI.html#.hijackSubmit">hijackSubmit</a></li><li data-type='method'><a href="module-UI.html#.loading">loading</a></li></ul></li><li><a href="module-Utils.html">Utils</a><ul class='methods'><li data-type='method'><a href="module-Utils.html#.dateTimeFormat">dateTimeFormat</a></li><li data-type='method'><a href="module-Utils.html#.generateRandomId">generateRandomId</a></li><li data-type='method'><a href="module-Utils.html#.isEmpty">isEmpty</a></li><li data-type='method'><a href="module-Utils.html#.retry">retry</a></li><li data-type='method'><a href="module-Utils.html#.round">round</a></li><li data-type='method'><a href="module-Utils.html#.sleep">sleep</a></li></ul></li></ul><h3>Classes</h3><ul><li><a href="FieldChangeLogger.html">FieldChangeLogger</a><ul class='methods'><li data-type='method'><a href="FieldChangeLogger.html#change">change</a></li><li data-type='method'><a href="FieldChangeLogger.html#clear">clear</a></li><li data-type='method'><a href="FieldChangeLogger.html#format">format</a></li></ul></li><li><a href="module-Subform-Subform.html">Subform</a><ul class='methods'><li data-type='method'><a href="module-Subform-Subform.html#getDatas">getDatas</a></li><li data-type='method'><a href="module-Subform-Subform.html#getFormGroupId">getFormGroupId</a></li><li data-type='method'><a href="module-Subform-Subform.html#getFormGroupIds">getFormGroupIds</a></li><li data-type='method'><a href="module-Subform-Subform.html#getIndex">getIndex</a></li><li data-type='method'><a href="module-Subform-Subform.html#getInstance">getInstance</a></li><li data-type='method'><a href="module-Subform-Subform.html#getItem">getItem</a></li><li data-type='method'><a href="module-Subform-Subform.html#setDatas">setDatas</a></li><li data-type='method'><a href="module-Subform-Subform.html#summary">summary</a></li><li data-type='method'><a href="module-Subform-Subform.html#updateItem">updateItem</a></li></ul></li></ul>
    
</nav>

<div id="main">
    
    <h1 class="page-title">Subform</h1>
    

    




<section>

<header>
    
</header>

<article>
    
        <div class="container-overview">
        
            

<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>子表单相关工具方法</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="subform.js.html">subform.js</a>, <a href="subform.js.html#line1">line 1</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>




            
                <div class="description usertext">子表单相关工具方法</div>
            

            
        
        </div>
    

    

    

    
        <h3 class="subsection-title">Classes</h3>

        <dl>
            <dt><a href="module-Subform-Subform.html">Subform</a></dt>
            <dd></dd>
        </dl>
    
    
    

     

    

    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    <h4 class="name" id=".associateForm2Subform"><span class="type-signature type-signature-async, static">(async, static) </span>associateForm2Subform<span class="signature">(context, formType, assocaiteFieldId, localSubformId, formInstIdField, fieldMaps, isDataFromSubform, remoteSubformId, options)</span><span class="type-signature"></span></h4>

    




<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>将关联表单的数据填充到本表单的子表上</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="subform.js.html">subform.js</a>, <a href="subform.js.html#line512">line 512</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>











    <h5 class="h5-examples">Example</h5>
    
    <pre class="prettyprint"><code>export function onAssocciateFormChange() {
  // 将关联表单对应的表单值填充到本表单子表中
  associateForm2Subform(
    this,
    "form",
    "associationFormField_lrimaemr",
    "tableField_xxxxxx",
    "textField_xxxxxx",
    [{from: "textField_xxxxxx", to: "textField_xxxxxx", type: "string" }],
    false,
    { keepOldData: true }
  );
}</code></pre>




    <h5 class="h5-parameters">Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>context</code></td>
            

            <td class="type">
            
                
<span class="param-type">object</span>



            
            </td>

            

            

            <td class="description last">this上下文</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>formType</code></td>
            

            <td class="type">
            
                
<span class="param-type">"form"</span>
|

<span class="param-type">"process"</span>



            
            </td>

            

            

            <td class="description last">表单类型</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>assocaiteFieldId</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            

            

            <td class="description last">关联表单组件唯一标识</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>localSubformId</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            

            

            <td class="description last">本表单子表唯一标识</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>formInstIdField</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            

            

            <td class="description last">子表中用于存储关联表单实例Id的字段，用于判断子表数据应该删除还是新增</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>fieldMaps</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;<a href="module-Subform.html#~FieldMapItem">module:Subform~FieldMapItem</a>></span>



            
            </td>

            

            

            <td class="description last">字段填充映射</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>isDataFromSubform</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            

            

            <td class="description last">填充数据是否来自关联表单的子表</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>remoteSubformId</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            

            

            <td class="description last">关联表单子表ID</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="module-Subform.html#~AF2SubformOption">module:Subform~AF2SubformOption</a></span>



            
            </td>

            

            

            <td class="description last">扩展配置</td>
        </tr>

    
    </tbody>
</table>



















        
            

    

    <h4 class="name" id=".sum2Main"><span class="type-signature type-signature-static">(static) </span>sum2Main<span class="signature">(context, tableFieldId, fieldInSubform, fieldInMainform, dataType, option)</span><span class="type-signature"></span></h4>

    




<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>子表字段汇总到主表</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="subform.js.html">subform.js</a>, <a href="subform.js.html#line318">line 318</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>











    <h5 class="h5-examples">Example</h5>
    
    <pre class="prettyprint"><code>export function onSubformChange() {
  // tableField_xyz子表中的 textField_123 字段将被汇总到主表 textField_abc 字段。
  sum2Main(this, "tableField_xyz", "textField_123", "textField_abc", "string", { appendMode: true });
}</code></pre>




    <h5 class="h5-parameters">Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>context</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last">this上下文</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>tableFieldId</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            

            

            <td class="description last">子表唯一标识</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>fieldInSubform</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            

            

            <td class="description last">要汇总到主表的子表字段</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>fieldInMainform</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            

            

            <td class="description last">要汇总到的主表字段</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>dataType</code></td>
            

            <td class="type">
            
                
<span class="param-type">"string"</span>
|

<span class="param-type">"number"</span>
|

<span class="param-type">"dpt"</span>
|

<span class="param-type">"employee"</span>



            
            </td>

            

            

            <td class="description last">字段数据类型，默认为string类型</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>option</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="module-Subform.html#~SumOption">module:Subform~SumOption</a></span>



            
            </td>

            

            

            <td class="description last">扩展选项</td>
        </tr>

    
    </tbody>
</table>



















        
            

    

    <h4 class="name" id="~resolveFieldMaps"><span class="type-signature type-signature-inner">(inner) </span>resolveFieldMaps<span class="signature">(formData, fieldMaps, mainFormData)</span><span class="type-signature"> &rarr; {Object}</span></h4>

    




<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>处理字段映射，组装并返回新的表单数据对象</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="subform.js.html">subform.js</a>, <a href="subform.js.html#line426">line 426</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>













    <h5 class="h5-parameters">Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>formData</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last">来源表单数据，如果来源为关联表单子表则为子表数据项目</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>fieldMaps</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;<a href="module-Subform.html#~FieldMapItem">module:Subform~FieldMapItem</a>></span>



            
            </td>

            

            

            <td class="description last">字段映射定义</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>mainFormData</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last">主表数据，如果来源是关联表单子表则该字段传主表数据，否则传null</td>
        </tr>

    
    </tbody>
</table>
















<h5 class="h5-returns">Returns:</h5>

        
<div class="param-desc">
    新的表单数据对象
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Object</span>



    </dd>
</dl>

    



        
    

    
        <h3 class="subsection-title">Type Definitions</h3>

        
                
<h4 class="name" id="~AF2SubformOption">AF2SubformOption</h4>





<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>AF2SubformOption 配置类型定义</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="subform.js.html">subform.js</a>, <a href="subform.js.html#line414">line 414</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>



    <h5 class="subsection-title">Properties:</h5>

    

<table class="props">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>keepOldData</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            

            

            <td class="description last">是否保留非关联表单填充的旧数据，默认为true</td>
        </tr>

    
    </tbody>
</table>






<div class="description usertext">
    AF2SubformOption 配置类型定义
</div>



    <h5 class="h5-types">Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Object</span>



        </li>
    </ul>






            
                
<h4 class="name" id="~FieldMapItem">FieldMapItem</h4>





<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>FieldMap配置类型定义</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="subform.js.html">subform.js</a>, <a href="subform.js.html#line406">line 406</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>



    <h5 class="subsection-title">Properties:</h5>

    

<table class="props">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>from</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            

            

            <td class="description last">源字段</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>to</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            

            

            <td class="description last">填充字段</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>type</code></td>
            

            <td class="type">
            
                
<span class="param-type">"string"</span>
|

<span class="param-type">"number"</span>
|

<span class="param-type">"employee"</span>
|

<span class="param-type">"dpt"</span>



            
            </td>

            

            

            <td class="description last">字段数据类型</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>multiSelect</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            

            

            <td class="description last">是否多选字段，type为employee时有用</td>
        </tr>

    
    </tbody>
</table>






<div class="description usertext">
    FieldMap配置类型定义
</div>



    <h5 class="h5-types">Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Object</span>



        </li>
    </ul>






            
                
<h4 class="name" id="~SubformSetDatasOption">SubformSetDatasOption</h4>





<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>setDatas 方法 option 参数类型定义</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="subform.js.html">subform.js</a>, <a href="subform.js.html#line17">line 17</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>



    <h5 class="subsection-title">Properties:</h5>

    

<table class="props">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>doNotValidate</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            

            

            <td class="description last">是否阻止自动校验，默认为 false</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>formatted</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            

            

            <td class="description last">是否已经格式化，默认为 false</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>triggerChange</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            

            

            <td class="description last">是否触发组件值变化事件，默认为 true</td>
        </tr>

    
    </tbody>
</table>






<div class="description usertext">
    setDatas 方法 option 参数类型定义
</div>



    <h5 class="h5-types">Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Object</span>



        </li>
    </ul>






            
                
<h4 class="name" id="~SubformSummaryOption">SubformSummaryOption</h4>





<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>summary 方法 option 参数类型定义</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="subform.js.html">subform.js</a>, <a href="subform.js.html#line9">line 9</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>



    <h5 class="subsection-title">Properties:</h5>

    

<table class="props">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>ignoreEmpty</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            

            

            <td class="description last">是否跳过空数据，默认为true</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>ignoreDuplicate</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            

            

            <td class="description last">是否跳过重复数据，默认为true</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>filter</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            

            

            <td class="description last">一个数据过滤函数，接受子表行数据作为参数，返回falsy值跳过当前行</td>
        </tr>

    
    </tbody>
</table>






<div class="description usertext">
    summary 方法 option 参数类型定义
</div>



    <h5 class="h5-types">Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Object</span>



        </li>
    </ul>






            
                
<h4 class="name" id="~SumOption">SumOption</h4>





<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>sum2Main option 参数类型定义</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="subform.js.html">subform.js</a>, <a href="subform.js.html#line292">line 292</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>



    <h5 class="subsection-title">Properties:</h5>

    

<table class="props">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>ignoreEmpty</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            

            

            <td class="description last">是否跳过空数据，默认为true</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>ignoreDuplicate</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            

            

            <td class="description last">是否跳过重复数据，默认为true</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>appendMode</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            

            

            <td class="description last">追加模式，数据追加到主表字段上，而不是覆盖，默认为false</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>filter</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            

            

            <td class="description last">一个数据过滤函数，接受子表行数据作为参数，返回falsy值跳过当前行</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>separator</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            

            

            <td class="description last">当数据类型为string时的分隔符，默认为半角逗号","</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>decimalPlaces</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            

            

            <td class="description last">当数据类型为number时，结果四舍五入到几位小数，默认不做舍入，可能存在浮点数精度问题</td>
        </tr>

    
    </tbody>
</table>






<div class="description usertext">
    sum2Main option 参数类型定义
</div>



    <h5 class="h5-types">Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Object</span>



        </li>
    </ul>






            
    

    
</article>

</section>




    
    
</div>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Tue Mar 19 2024 17:01:50 GMT+0800 (中国标准时间) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
<script src="scripts/polyfill.js"></script>
<script src="scripts/linenumber.js"></script>

<script src="scripts/search.js" defer></script>



</body>
</html>